package com.wing.wecom.controller;

import chat.qiye.wechat.sdk.api.contact.ContactDeptApi;
import chat.qiye.wechat.sdk.api.contact.resp.ContactDeptCreateResp;
import chat.qiye.wechat.sdk.api.contact.resp.ContactDeptListResp;
import chat.qiye.wechat.sdk.api.contact.vo.ContactDeptVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author : Hui.Wang [huzi.wh@gmail.com]
 * @version : 1.0
 * @date : 2021/9/14
 */
@RestController
public class DeptController {

    @Resource
    ContactDeptApi contactDeptApi;

    @GetMapping("/dept/list")
    public ContactDeptListResp list(Integer id) {
        return contactDeptApi.list(id);
    }

    /**
     * 创建部门
     * @param contactDeptVo
     * @return
     */
    @GetMapping("/dept/create")
    public ContactDeptCreateResp create(ContactDeptVo contactDeptVo) {
        return contactDeptApi.create(contactDeptVo);
    }

}
